<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
<h:head>
  <title><ui:insert name="title">Ekstrabilet</ui:insert></title>
  <link rel="stylesheet" type="text/css" href="theme.css" />
 
</h:head>
<body>
<div id="container">
			     <div id="header"> header </div>	
				<div id="login">
					<h:form id="logIn" rendered="#{!userBean.logged}">
					<h:outputLabel>Login</h:outputLabel>
					<h:inputText id="login" value="#{userBean.login}" required="true" requiredMessage="Please insert login"/>
					<h:message for="login" style="color:red;"/>
			
					<h:outputLabel>Password</h:outputLabel>
					<h:inputSecret id="password" value="#{userBean.password}" required="true" requiredMessage="Please insert password"/>
					<h:message for="password" style="color:red;"/>
					
					<h:commandButton value="LogIn" action="#{userBean.logIn}"/>
					
					<h:commandButton value="Register" action="#{userBean.register}" immediate="true"/>
					</h:form>
				

					<h:form id="logOut" rendered="#{userBean.logged}">
					<h:outputLabel value="#{userBean.login} logged in "></h:outputLabel>
					<h:commandButton value="LogOut" action="#{userBean.logOut}" />
			
					</h:form>
					<h:messages globalOnly="true" layout="table"/>
					<h:message for="logIn"/>
				</div>		
			<div id="texty">
				<div id="menu1"> 
					<div id="menutext">
					<h:panelGroup rendered="#{userBean.user.type == 'Administration' || userBean.user.type == 'Technical service'}">
					<a href="addStadium.xhtml" >Add new stadium</a>
					<br/>
					<a href="addGame.xhtml">Add new Game</a>
					<br/>
					</h:panelGroup>
					<h:panelGroup rendered="#{userBean.user.type == 'Administration'}">
					<a href="adminPane.xhtml">Administration panel</a>
					</h:panelGroup>
					<br/>
					<a href="searchGame.xhtml">Search for a Game</a>
					<br/>
					<h:panelGroup rendered="#{userBean.logged}">
						<a href="cart.xhtml">My cart</a>
					</h:panelGroup>
					</div>
	 			</div>
	 			<div id="text"> 
					<div id="content"> 
					<ui:insert name="content">
				
					</ui:insert>
					</div>
				</div> 
			</div>
			
</div>
</body>


</html>
